<script setup>
import { useRouter } from 'vue-router'

const router = useRouter()

// 导航到首页
const goToHome = () => {
  router.push('/')
}
</script>

<template>
  <footer class="footer">
    <div class="footer-container">
      <div class="footer-left">
        <div class="logo" @click="goToHome">
          <svg class="logo-icon" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg">
            <circle cx="30" cy="30" r="25" fill="#3a86ff"/>
            <path d="M25 25 L35 25 L35 35 L25 35 Z" fill="white"/>
            <path d="M40 30 L35 30" stroke="white" stroke-width="3" stroke-linecap="round"/>
          </svg>
          <span class="logo-text">电影天地</span>
        </div>
        <p class="copyright">© 2024 电影天地. 保留所有权利</p>
      </div>
      <div class="footer-links">
        <a href="/" class="footer-link" @click.prevent="goToHome">首页</a>
        <a href="/about" class="footer-link" @click.prevent="router.push('/about')">关于我们</a>
        <a href="/terms" class="footer-link" @click.prevent="router.push('/terms')">使用条款</a>
        <a href="/privacy" class="footer-link" @click.prevent="router.push('/privacy')">隐私政策</a>
      </div>
    </div>
  </footer>
</template>

<style scoped>
/* 页脚样式 */
.footer {
  background-color: var(--white);
  border-top: 1px solid var(--border-color);
  padding: 24px 0;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer .logo {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.footer .logo-icon {
  width: 24px;
  height: 24px;
  margin-right: 8px;
}

.footer .logo-text {
  font-size: 16px;
  font-weight: bold;
  color: var(--primary-color);
}

.copyright {
  font-size: 12px;
  color: var(--text-light);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-link {
  font-size: 14px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--primary-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
  
  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }
}
</style>